package time;

import java.time.Instant;
import java.time.ZoneId;
import java.time.ZonedDateTime;

public class InstantTest {
    public static void main(String[] args) {
        Instant now = Instant.now();
        ZonedDateTime zonedDateTime = now.atZone(ZoneId.of("Asia/Shanghai"));
        System.out.println(now);
        System.out.println(zonedDateTime);
//        System.out.println(now.get(ChronoField.MINUTE_OF_HOUR)); //报错，不能这样用
    }
}
